using System;
using System.Collections.Generic;
using System.Text;
using ServerLogicDll;
using System.Net;

namespace TestConsoleServer
{
    class Program
    {
        static void Main(string[] args)
        {
           //make aloop listening to clients
            Server server = new Server(IPAddress.Parse("127.0.0.1"), 100);
            server.NewClientConnected += new EventHandler<ClientConnectedEventArgs>(server_NewClientConnected);
            server.DisconnectClient += new EventHandler<ClientDisonnectEventArgs>(server_DisconnectClient);
            Console.ReadLine();
           
            /*
            Server server = new Server(IPAddress.Parse("127.0.0.1"), 100);
            server.NewClientConnected += new EventHandler<ClientConnectedEventArgs>(server_NewClientConnected);
            server.DisconnectClient += new EventHandler<ClientDisonnectEventArgs>(server_DisconnectClient);
            Console.ReadLine();
            */
        }

        static void server_DisconnectClient(object sender, ClientDisonnectEventArgs e)
        {
            Console.WriteLine(e.UserName + " has disconnected");
        }

        static void server_NewClientConnected(object sender, ClientConnectedEventArgs e)
        {
            Console.WriteLine(e.UserName + " has connected");
        }
    }
}
